<template>
  <a-modal
    :title="title"
    :visible="visible"
    :mask-closable="false"
    :body-style="{paddingBottom: '8px'}"
    :confirm-loading="submitLoading"
    @ok="handleSubmit"
    @cancel="handleClose"
  >
    <a-form
      :form="form"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
    >
      <a-form-item v-if="isUpdateForm" style="display: none">
        <a-input v-decorator="['id']" />
      </a-form-item>
      <a-form-item label="卡号">
        <a-input v-decorator="['cardNumber']" placeholder="卡号" />
      </a-form-item>
      <a-form-item label="MO编号">
        <a-input v-decorator="['moNumber']" placeholder="MO编号" />
      </a-form-item>
      <a-form-item label="物料编码">
        <a-input v-decorator="['materialCode']" placeholder="物料编码" />
      </a-form-item>
      <a-form-item label="物料名称">
        <a-input v-decorator="['materialName']" placeholder="物料名称" />
      </a-form-item>
      <a-form-item label="规格型号">
        <a-input v-decorator="['specification']" placeholder="规格型号" />
      </a-form-item>
      <a-form-item label="材质">
        <a-input v-decorator="['materialType']" placeholder="材质" />
      </a-form-item>
      <a-form-item label="表面处理">
        <a-input v-decorator="['surfaceTreatment']" placeholder="表面处理" />
      </a-form-item>
      <a-form-item label="数量">
        <a-input v-decorator="['quantity']" placeholder="数量" />
      </a-form-item>
      <a-form-item label="单位">
        <a-input v-decorator="['unit']" placeholder="单位" />
      </a-form-item>
      <a-form-item label="计划开始时间">
        <a-input v-decorator="['plannedStartTime']" placeholder="计划开始时间" />
      </a-form-item>
      <a-form-item label="计划结束时间">
        <a-input v-decorator="['plannedEndTime']" placeholder="计划结束时间" />
      </a-form-item>
      <a-form-item label="生命周期">
        <a-input v-decorator="['lifecycle']" placeholder="生命周期" />
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
import { PopUpFormMixin } from '@/mixins'
import { addObj, putObj } from '@/api/ProductionProcesses/t-process-flow-card'

export default {
  name: 'TProcessFlowCardModalForm',
  mixins: [PopUpFormMixin],
  data () {
    return {
      reqFunctions: {
        create: addObj,
        update: putObj
      },

      labelCol: {
        sm: { span: 24 },
        md: { span: 5 }
      },
      wrapperCol: {
        sm: { span: 24 },
        md: { span: 19 }
      },

      // 校验配置
      decoratorOptions: {}
    }
  },
  methods: {}
}
</script>